<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>第2章 数据类型与变量</title>
</head>
<body>
<script>
    var myFirstVariable;
    myFirstVariable = 100;
    var myVariable;
    var myOtherVariable;
    myOtherVariable = 22;
    myVariable = myOtherVariable;

    var totalCostOfShopping;
    totalCostOfShopping = 10 + 5 + 5;
    alert(totalCostOfShopping);

    var increment = 1;
    var decrement = 1;
    increment = increment + 1;
    decrement = decrement - 1;

    increment++;
    decrement--;

    ++increment;
    --decrement;


    var myVar;
    myVar = increment++ - 20;
    console.log(increment);
    alert(myVar);

    increment = 1;
    myVar = ++increment - 20;
    alert(myVar);

    increment = 1;
    myVar = increment++ * 10 + 1;
    console.log(increment);
    alert(myVar);

    increment = 1;
    myVar = ++increment * 10 + 1;
    alert(myVar);

    myVar += 6;
    myVar = myVar + 6;

    myVar -= 6;
    myVar *= 6;

    myVar = myVar - 6;
    myVar = myVar * 6;

    var priority = 1 + 2 * 3;
    alert(priority);

    var helloPaul = 'Hello ' + 'Paul';
    alert(helloPaul);

    var degreesCentigrade = '56.02 degrees centigrade';
    var notANumber = "I'm a name not a number";
    alert(degreesCentigrade);
    alert(notANumber);

    //    Array instantiation can be simplified.
    //    var createArray = new Array();
    var createArray = [];
    console.log(createArray);

    var statementArray;
    statementArray = [];

    var assignArray = ['Paul', 234, 'John', 112, 'Bob', 99];
    console.log(assignArray);

    var multiLineAssignArray = [];
    multiLineAssignArray[0] = 'Paul';
    multiLineAssignArray[1] = 345;
    multiLineAssignArray[2] = "John";
    multiLineAssignArray[3] = 112;
    multiLineAssignArray[4] = 'Bob';
    multiLineAssignArray[5] = 99;

    var fiveRankArray = [];
    fiveRankArray[0] = [];
    fiveRankArray[0][0] = [];
    fiveRankArray[0][0][0] = [];
    fiveRankArray[0][0][0][0] = [];
    fiveRankArray[0][0][0][0][0] = 'This is getting out of hand';

    document.write(fiveRankArray[0][0][0][0][0]);
</script>
</body>
</html>